{% extends 'layout.html' %}
{% block content %}

	<div class="container">
		<div style="margin-bottom: 10px" class="clear_clearfix">{# 跟下面距离10个象素 #}
			<a class="btn btn-success" href="/admin/add/">{# 绿色success #}{# 在新页面打开target="_blank" #}
				<span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>{# 新建部门 #}
				新建管理员
			</a>

			<div style="float: right; width:500px;">
				<form method="get">
					<div class="input-group">
						<input type="text" name="q" class="form-control" placeholder="搜索关键字..." value="{{ search_data }}">
						<span class="input-group-btn">
							<button type="submit" class="btn btn-default">
                             <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
							</button>
						</span>

					</div>
				</form>
			</div>

		</div>

		<div class="panel panel-default">
			<div class="panel-heading">
				<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>{# 在部门列表前加图标 #}
				管理员列表
			</div>
			<div class="panel-body">
				<table class="table table-bordered table-striped ">{# 带边宽,带条纹 #}
					<thead>
					<tr>
						<th>ID</th>
						<th>用户名</th>
						<th>密码</th>
						<th>重置密码</th>
						<th>操作</th>

					</tr>
					</thead>
					<tbody>
					{% for obj in queryset %}
						<tr>
							{#							循环取得列表内容#}
							<td>{{ obj.id }}</td>
							<td>{{ obj.username }}</td>
							<td>******</td>
							<td>
								<a href="/admin/{{ obj.id }}/reset/">重置密码</a>
							</td>

							<td>
								<a class="btn btn-primary btn-xs"
								   href="/admin/{{ obj.id }}/edit">编辑</a>{# 蓝色primary #}{# 把id传到视图函数中 #}
								<a class="btn btn-danger btn-xs"
								   href="/admin/{{ obj.id }}/delete">删除</a>{# 红色danger #}
							</td>

						</tr>
					{% endfor %}

					</tbody>
				</table>
			</div>
			<ul class="pagination" style="float: left">
				{{ page_string }}
			</ul>

		</div>
	</div>



{% endblock %}






















